# V1.0版本
# import random
# num=random.randint(1,100)
# guss=int(input("请输入你猜的数字"))
# if guss>num:
#     print("大了")
# elif guss<num:
#     print("小了")
# else:
#     print(f"恭喜猜中，本轮幸运数字：{guss}")
# V2.0版本
# money=5000
# import random
# num=random.randint(1,100)
# while(money>0):
#     guss = int(input("请输入你猜的数字"))
#     if guss > num:
#         print("大了")
#         money = money - 500
#     elif guss<num:
#         print("小了")
#         money = money - 500
#     else:
#         print(f"恭喜猜中，本轮幸运数字：{guss},奖励3000金币")
#         money=money+3000
# V3.0版本
money=5000
import random
num=random.randint(1,100)
while(money>0):
    guss = int(input("请输入你猜的数字"))
    if guss > num:
        print("大了")
        money = money - 500
    elif guss<num:
        print("小了")
        money = money - 500
    else:
        print(f"恭喜猜中，本轮幸运数字：{guss}，,奖励3000金币")
        money=money+3000
        choice=int(input("是否继续游戏？，输入1继续游戏，输入0退出游戏"))
        if choice==1:
            num = random.randint(1, 100)
        else:
            break

